<template>
<div class="container__">
    <div class="erweima">
        <div class="wxq">微信群</div>
        <div class="ewm">
            <img :src="info.erweima" alt="">
        </div>
            <div class="tex">
                <h3>保存二维码，微信扫一扫</h3>
                <h3>赶紧加入群聊吧</h3>
            </div>
        </div>
        <div class="button" @click="baochun">
            保存图片
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            info:{}
        }
    },
    methods: {
        baochun() {
            wx.getImageInfo({
                src: this.info.erweima,
                success:(ret) => {
                    var path = ret.path;
                    wx.saveImageToPhotosAlbum({
                        filePath: path,
                        success:(result) =>  {
                          wx.showToast({
                            title: '保存成功',
                            success:(result) => {
                               
                            },
                            fail: () => {},
                            complete: () => {}
                          });
                        }
                    })
                }
            })
        }
    },
    onLoad(){
        Object.assign(this.$data, this.$options.data())
        this.info=JSON.parse(this.$mp.query.info)
        console.log(this.info)
    }
}
</script>

<style lang="scss">
.container__ {
    background-color: #fff;
    min-height: 100vh;
    font-size: 16px;
    padding: 40px 0;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    align-items: center;

    .button {
        width: 305px;
        height: 45px;
        background: rgba(26, 132, 251, 1);
        border-radius: 5px;
        font-size: 15px;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 65px;
    }

    .erweima {
        width: 345px;
        height: 353px;
        background: rgba(255, 255, 255, 1);
        border: 1px solid rgba(62, 156, 254, 1);
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;

        .wxq {
            // width: 71px;
            // height: 23px;
            font-size: 24px;
            // font-family: PingFang-SC-Bold;
            font-weight: bold;
            color: rgba(51, 51, 51, 1);
            line-height: 30px;

            background: linear-gradient(270deg, rgba(211, 29, 238, 1) 0%, rgba(48, 73, 236, 1) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .ewm {
            width: 164px;
            height: 158px;
            border-radius: 3px;
            border: 1px solid #ddd;

            img {
                height: 100%;
                width: 100%;
            }
        }

        .tex {
            font-size: 15px;
            color: #333333;
            text-align: center;
            line-height: 30px;
        }
    }
}
</style>
